﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class UserControls_ModalConfirmationPopup : BaseUserControl
{
    #region Public/Protected Properties
    private JSCallBackMethods _jsCallBackMethod = JSCallBackMethods.None;

    public enum JSCallBackMethods
    {
        SendToDeleteUrl,
        None
    }
    public enum DialogType
    {
        OK,
        YesNo,
        Cancel
    }
    public JSCallBackMethods JavaScriptCallBackMethod
    {
        get { return _jsCallBackMethod; }
        set { _jsCallBackMethod = value; }
    }
    public DialogType ModalDialogType
    {
        get;
        set;
    }
    protected String JSCallBackMethod
    {
        get
        {
            if (this.JavaScriptCallBackMethod == JSCallBackMethods.SendToDeleteUrl)
                return "onclick='SendToDeleteUrl();'";
            return String.Empty;
        }
    }
    #endregion Public/Protected Properties
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.ModalDialogType == DialogType.YesNo && this.JavaScriptCallBackMethod == JSCallBackMethods.None)
            throw new ArgumentException(String.Format("{0}: You Must Specify the Java Script Call Back Method for YesNo Dialog Box!", this.ID));

    }
}
